#define  _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
//二进制中不同数的计算
 //第一种方法
int main()
{
	int n, m;
	int count = 0;
	scanf("%d %d", &n, &m);
	for (int i = 0; i < 32; i++)
	{
		if (((n >> i) & 1) != ((m >> i) & 1))
		{
			count++;
	 }
	}
	printf("%d\n", count);
}
//第二种方法
int p(int ret)
{
	int count = 0;
	while (n)
	{
		n &= (n - 1);
		count++;
	}
	return count;
}
int main()
{
	int n, m;
	scanf("%d %d", &n, &m);
	int ret = m ^ n;
	printf("%d\n", p(ret));
}